#ifndef OBSTACLE_H
#define OBSTACLE_H

class Color {
public:
	unsigned char r, g, b;
};

class Obstacle {
public:
	enum Type {
		Left,
		Right,
		Top,
		Bottom,
		TopLeft,
		TopRight,
		BottomLeft,
		BottomRight
	};

	Obstacle(Type type, int size1, int time);
	Obstacle(Type type, int size1, int size2, int time, int duration);
	Obstacle(const Obstacle & obstacle);
	~Obstacle();

	inline Obstacle::Type getType() { return type; }
	inline int getSize1() { return size1; }
	inline int getSize2() { return size2; }
	inline int getTime() { return time; }
	inline int getDuration() { return duration; }
	Color getColor();

	Obstacle & operator=(const Obstacle & obstacle);
	friend bool operator<(Obstacle & lhs, Obstacle & rhs);

private:
	Type type;
	int size1, size2;
	int time, duration; // in milliseconds
	Color color;

	void calculateColor();
};

bool operator <(Obstacle & lhs, Obstacle & rhs);

#endif // OBSTACLE_H
